package com.mall.shopping.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.shopping.constants.ShoppingRetCode;
import lombok.Data;

/**
 * @Classname TestProductInfoRequest
 * @Description
 * @Date 2021/8/24 19:04
 * @Author terrance_swn
 */
@Data
public class TestProductInfoRequest extends AbstractRequest {

    //请求参数
    Long productId;

    @Override
    public void requestCheck() {

        //请求参数校验
        if(productId < 0){
            throw new ValidateException(
                    ShoppingRetCode.PARAMETER_VALIDATION_FAILED.getCode(),
                    ShoppingRetCode.PARAMETER_VALIDATION_FAILED.getMessage()
            );
        }
    }
}
